package monkeyTalk;


import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.junit.Test;

public class ExecuteShellScript_LunchAppInDevice {

  @Test
  public void executeShellScript() throws Exception {

    System.out.println("Starting....");
    String line;
    ProcessBuilder builder =
        new ProcessBuilder("/bin/bash", "./shell/launch_app_from_commandline.sh");
    builder.redirectErrorStream(true);
    Process process = builder.start();
    InputStream stdout = process.getInputStream();
    BufferedReader reader = new BufferedReader(new InputStreamReader(stdout));
    line = reader.readLine();
    System.out.println("Waiting for few secs till the App Launches....");
    Thread.sleep(15000);
    System.out.println("Ending....");


  }

}
